1. Field of the Invention
The present invention is related generally to a data processing system and in particular to a method and apparatus for executing code. More particularly, the present invention is directed to a computer implemented method, apparatus, and computer usable program code for testing of error handling code in software applications.
2. Description of the Related Art
A software component contains blocks of code. Each block of code is a portion of code for performing a particular task. A software component may contain one or more conditional branches. A conditional branch determines whether a specific condition is present, and based on the determination; the software component executes a specific block in the software component. Thus, each condition may have a corresponding block of code which is executed when the condition is present. One example of a conditional branch is determining whether an error condition is present. In this example, when a specific error condition is present, the software component executes the block of code corresponding to the error condition.
When testing a software component, executing all possible blocks of code in the software component is difficult, because many error conditions only occur rarely and may be difficult to create or simulate.